<template>
    <view>
        <custom><template #backText>我的慈善账户</template></custom>
        <nBar title="我的捐赠" :right_title="'共捐赠 '+(page.charity_times||0)+' 次'"></nBar>
        <nGrid row="2" col="2" :border="true" :list="grid_charity_total" :value_info="page" class_name="text-gray"
            class_value="margin-top-10 text-nddyny text-xl"></nGrid>
        <nBar title="相关日志" right_title="查看全部日志" right_uri="/user/asset/log"></nBar>
        <userAssetLogTimeline ref="userAssetLogTimeline" :parentForm="userAssetLog.form"></userAssetLogTimeline>
    </view>
</template>

<script>
    import userAssetLogTimeline from '@/components/nddyny/userAssetLogTimeline.vue';
    export default {
        components: {
            userAssetLogTimeline,
        },
        data() {
            return {
                grid_charity_total: {
                    gold_share_amount: {
                        name: '捐赠金股'
                    },
                    balance_amount: {
                        name: '捐赠提现红包'
                    },
                    gold_coupon_amount: {
                        name: '捐赠金券'
                    },
                    gold_bean_amount: {
                        name: '捐赠金豆'
                    },
                },
                page: {
                    charity_times: '',
                    gold_share_amount: '',
                    gold_coupon_amount: '',
                    gold_bean_amount: '',
                    balance_amount: '',
                },
                userAssetLog: {
                    form: {
                        action_types: '801'
                    },
                },
            }
        },
        onLoad() {
            this.pageInit(this.$api.list_action_page_init);
        },
        methods: {
            pageInit(action) {
                this.$api.post(this, {
                    action,
                    url: '/project/charity/myPage',
                    success: (Result) => {
                        if (this.$api.form.toast(this, Result)) return;
                        this.page = Result.result;
                    }
                });
            },
        },
    }
</script>
